Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[usdMaya] Clearing out the prim writers before saving the stage. #229

Merged

Conversation

sirpalee
Copy link
Contributor

The change is super simple here; we are clearing the prim writers before saving the stage. This change is useful when somebody wants to run cleanup code in a primWriter's destruction. Otherwise, there is no way to track down the last write to get the same effect.

For example, we have been using feature successfully with some of our writers to optimize animation data before saving the stage.

@jtran56
Copy link

jtran56 commented Jun 22, 2017

Filed as internal issue #147936.

Copy link
Contributor

@sunyab sunyab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing along more notes from our sets team, thanks!

@@ -348,11 +348,13 @@ void usdWriteJob::endJob()
// prim for the export... usdVariantRootPrimPath
mJobCtx.mStage->GetRootLayer()->SetDefaultPrim(defaultPrim);
}
// clear this so that no stage references are left around
// and running code in destructors
mJobCtx.mMayaPrimWriterList.clear();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having an explicit hook would be preferred to doing stuff in a destructor here - I'd rather have an explicit call to some sort of "PostExport" callback (or virtual function on the MayaPrimWriter base class)

Signed-off-by: Pal Mezei <palm@lumapictures.com>
@sirpalee
Copy link
Contributor Author

@sunyab sorry for the late reply, but I just got the PR updated. I added a separate postExport function that runs before saving the stage.

@pixar-oss pixar-oss merged commit ef86067 into PixarAnimationStudios:dev Jan 29, 2018
pixar-oss added a commit that referenced this pull request Jan 29, 2018
[usdMaya] Clearing out the prim writers before saving the stage.
@sirpalee sirpalee deleted the pr/clear_writers_before_save branch January 30, 2018 21:38
AdamFelt pushed a commit to autodesk-forks/USD that referenced this pull request Apr 16, 2024
…/internal-only/feature/pipeline_adsk

Re-Enable test TfSafeOutputFile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants